<?php

declare (strict_types=1);

namespace App\Model;

use Hyperf\DbConnection\Model\Model;

/**
 * Class UserWithdrawLog
 * @package App\Model
 * @property int user_withdraw_id
 * @property int user_id
 * @property int cooperative_id
 * @property int gold
 * @property int is_self_merchant
 * @property int gold_type
 * @property string receive_account
 * @property int receive_account_type
 * @property string created_at
 *
 * @property User user
 * @property Cooperative cooperative
 *
 */
class UserWithdrawLog extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'user_withdraw_log';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_id',
        'cooperative_id',
        'user_with_draw_id',
        'gold',
        'gold_type',
        'is_self_merchant',
        'receive_account'
    ];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [];

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }


    public function cooperative()
    {
        return $this->belongsTo(Cooperative::class, 'cooperative_id', 'id');
    }

}